const mongoose = require("../conf/db");

const schema = new mongoose.Schema({
  goodsName: {
    type: String,
    required: true
  },
  imgUrl: {
    type: String,
    required: true
  },
  infoImgUrl: {
    type: String,
    required: true
  },
  price: {
    type: Number,
    required: true
  },
  marketPrice: {
    type: Number,
    required: true
  },
  stock: {
    type: Number,
    required: false,
    default: 0
  }
});

const model = mongoose.model("goods", schema);

module.exports = model;
